package com.five.wisdomEat.service;

import com.five.wisdomEat.entity.RestaurantOrders;
import com.five.wisdomEat.mapper.RestaurantOrdersMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class QrCodeService {

    @Autowired
    private RestaurantOrdersMapper mapper;

    public RestaurantOrders findById(String roNumber) {
        RestaurantOrders restaurantOrders = mapper.selectQR(roNumber);
        if(restaurantOrders == null){
            return null;
        }else {
            return restaurantOrders;
        }
        // 根据qrCodeId查询数据库中的二维码记录
        // 返回二维码对象或null（如果未找到）
    }

    public void update(RestaurantOrders orders) {
         mapper.updateQR(orders.getRoNumber());
    }

    // 其他方法...
}
